﻿using System;
using AzukiMap.Tools;
using GeoAPI.Geometries;

namespace AzukiMap.Map
{
    public class MapExtentChangedArgs : EventArgs
    {
        IPolygon _extent = null;

        public MapExtentChangedArgs(IPolygon extent)
        {
            _extent = extent;
        }

        /// <summary>
        /// Current extent as a polygon.
        /// </summary>
        public IPolygon ExtentPolygon
        {
            get
            {
                return _extent;
            }
        }

        /// <summary>
        /// Extent by a double array.
        /// </summary>
        public double[] Extent
        {
            get
            {
                GeometryUtil geomUtil = GeometryUtil.Default;
                double[] extentArr = geomUtil.GetExtentPointsArr(_extent);
                return extentArr;
            }
        }

        /// <summary>
        /// Center point
        /// </summary>
        public IPoint Center
        {
            get
            {
                return _extent.Centroid;
            }
        }

    }
}
